home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
c
/
quikc21.zip
/
QWIKREF.DOC
< prev
next >
Wrap
Text File
|
1989-07-06
|
79KB
|
1,753 lines
QWIKC SCREEN UTILITIES
REFERENCE GUIDE
Version 2.1
June 1, 1989
Conversion to Turbo C / MS C by
Jordan Gallagher / Wisdom Research
Copyright (C) 1988,1989 Eagle Performance Software
All Rights Reserved.
_______
____|__ | (tm)
--| | |-------------------
| ____|__ | Association of
| | |_| Shareware
|__| o | Professionals
-----| | |---------------------
|___|___| MEMBER
QWIKC Screen Utilities Reference Guide, Version 2.1
T A B L E O F C O N T E N T S
1. INTRODUCTION . . . . . . . . . . . . . . . . . . . . . 3
Purpose . . . . . . . . . . . . . . . . . . . . . . . 3
Common Parameters . . . . . . . . . . . . . . . . . . 3
Attributes . . . . . . . . . . . . . . . . . . . . . 4
2. FUNCTIONS . . . . . . . . . . . . . . . . . . . . . . . 6
eosc . . . . . . . . . . . . . . . . . . . . . . . . 6
eosln . . . . . . . . . . . . . . . . . . . . . . . . 6
eosr . . . . . . . . . . . . . . . . . . . . . . . . 6
eostocursor . . . . . . . . . . . . . . . . . . . . . 6
eostorc . . . . . . . . . . . . . . . . . . . . . . . 7
eostorcrel . . . . . . . . . . . . . . . . . . . . . 7
getcursor . . . . . . . . . . . . . . . . . . . . . . 7
get_submodel_id . . . . . . . . . . . . . . . . . . . 7
gotoeos . . . . . . . . . . . . . . . . . . . . . . . 8
gotorc. . . . . . . . . . . . . . . . . . . . . . . . 8
modcursor . . . . . . . . . . . . . . . . . . . . . . 8
qattr . . . . . . . . . . . . . . . . . . . . . . . . 9
qattrc . . . . . . . . . . . . . . . . . . . . . . . 9
qattreos . . . . . . . . . . . . . . . . . . . . . . 9
qeosln . . . . . . . . . . . . . . . . . . . . . . . 10
qfill . . . . . . . . . . . . . . . . . . . . . . . . 10
qfillc . . . . . . . . . . . . . . . . . . . . . . . 10
qfilleos . . . . . . . . . . . . . . . . . . . . . . 11
qinit . . . . . . . . . . . . . . . . . . . . . . . . 11
qreadattr . . . . . . . . . . . . . . . . . . . . . . 12
qreadchar . . . . . . . . . . . . . . . . . . . . . . 12
qreadstr . . . . . . . . . . . . . . . . . . . . . . 12
qreinit . . . . . . . . . . . . . . . . . . . . . . . 12
qscrolldown . . . . . . . . . . . . . . . . . . . . . 13
qscrollup . . . . . . . . . . . . . . . . . . . . . . 13
qscrtovscr . . . . . . . . . . . . . . . . . . . . . 14
qstoretomem . . . . . . . . . . . . . . . . . . . . . 15
qstoretoscr . . . . . . . . . . . . . . . . . . . . . 15
qviewpage . . . . . . . . . . . . . . . . . . . . . . 16
qvscrtoscr . . . . . . . . . . . . . . . . . . . . . 17
qwrite . . . . . . . . . . . . . . . . . . . . . . . 18
qwritec . . . . . . . . . . . . . . . . . . . . . . . 18
qwriteeos . . . . . . . . . . . . . . . . . . . . . . 19
qwriteeos_sub . . . . . . . . . . . . . . . . . . . . 19
qwritepage . . . . . . . . . . . . . . . . . . . . . 19
qwrite_sub . . . . . . . . . . . . . . . . . . . . . 20
setcursor . . . . . . . . . . . . . . . . . . . . . . 20
setmultitask . . . . . . . . . . . . . . . . . . . . 21
wherec . . . . . . . . . . . . . . . . . . . . . . . 21
wherer . . . . . . . . . . . . . . . . . . . . . . . 22
3. VARIABLES . . . . . . . . . . . . . . . . . . . . . . . 23
System Hardware . . . . . . . . . . . . . . . . . . . 23
Video Hardware . . . . . . . . . . . . . . . . . . . 24
Video Software . . . . . . . . . . . . . . . . . . . 26
Video Cursor . . . . . . . . . . . . . . . . . . . . 28
2
QWIKC Screen Utilities Reference Guide, Version 2.1
1. I N T R O D U C T I O N
PURPOSE
This document is a QWIKC technical reference manual describing each routine
and variable in detail in a format similar to the Turbo C manual. The
routines are described in alphabetical order. Since this manual is on
disk, you can find your interest easily with a search utility.
Application - All QWIKC functions will perform in the following
applications:
. All video text modes - 0, 1, 2, 3 and 7.
. Any column mode - 40, 80, or variable.
. For IBM PC, XT, AT, PCjr, PC convertible, all PS/2 models, 3270 PC, and
compatibles.
. With MDA, CGA, EGA, MCGA, VGA, 8214/A, all Hercules video cards.
. Perform routines in absolute coordinates rather than window-relative
coordinates.
. Capitalizes on the use of faster multi-tasking video buffers (MTVB).
For window-relative writing routines, see WNDWC21.ARC.
COMMON PARAMETERS
Common Parameters - Most functions use the same parameter names. Rather
than repeating them for each routine, detailed descriptions for those
parameters are listed below.
Screen Coordinates - QWIKC routines work in absolute coordinates to give
you full control of the screen. The routines do not check for bounds on
the screen, so be sure to stay in range. The upper left column on the
screen is row 1, column 1, which is also called 1-based. The routines also
wrap to the next line; they do not truncate at end-of-line. For example,
row=1 and col=255 is equivalent to row=3 and col=15 on a screen with 80
columns. But this is not a recommended practice for variable screen
widths.
row/col - row and col were chosen in lieu of the X/Y scheme used in most
routines. Since QWIKC is for only text modes, the screen is treated like a
word processor with rows and columns. It is more intuitive to use the X/Y
scheme in graphics and the row/col scheme for text.
coll/colr - In the self-centering routines, the left and right columns are
simply averaged. To center on the full width of an 80 column display, set
coll=1 and colr=80. To center on a certain column number, set both values
equal to that column number. Or, to center on any screen, set coll=1 and
colr=crt_cols.
rows/cols - Using rows/cols is much easier than row2/col2 to describe the
height and width of a block such as:
qstoretomem( row, col, rows, cols, myptr );
3
QWIKC Screen Utilities Reference Guide, Version 2.1
Should you decide to move a block, only row and col need to be changed, and
therefore rows and cols don't need to be mentally recalculated and altered.
Please keep cols no greater than crt_cols. Zero values will simply exit
the routine.
astr - This parameter contains the address of the string.
ATTRIBUTES
attr - Use the convenient attribute macros for the foreground and
background colors supplied in the header file, for example:
qwrite( 1, 1, WHITE+BLUE_BG, "My String" );
will write the text with white on blue attributes. The foreground macros
in QWIKC21.H are duplicates of those in Turbo C's conio.h:
BLACK 0x00 DARKGRAY 0x08
BLUE 0x01 LIGHTBLUE 0x09
GREEN 0x02 LIGHTGREEN 0x0A
CYAN 0x03 LIGHTCYAN 0x0B
RED 0x04 LIGHTRED 0x0C
MAGENTA 0x05 LIGHTMAGENTA 0x0D
BROWN 0x06 YELLOW 0x0E
LIGHTGRAY 0x07 WHITE 0x0F
BLINK 0x80
For convenience, background color macros were included so that the
foreground and background macros could be added for the complete attribute.
BLACK_BG 0x00
BLUE_BG 0x10
GREEN_BG 0x20
CYAN_BG 0x30
RED_BG 0x40
MAGENTA_BG 0x50
BROWN_BG 0x60
LIGHTGRAY_BG 0x70
SAMEATTR -1
SAMEATTR - A powerful and unique feature of all QWIKC routines is the use
of the macro SAMEATTR. If SAMEATTR, or a negative value, is used as an
attribute, the routine will suppress any changes to the attributes and use
what is currently on the screen.
3270 PC Attributes - Be aware that the 3270 PC ignores the foreground
intensity bit, so there are only 8 colors. In addition, 4 colors have
different tints:
4
QWIKC Screen Utilities Reference Guide, Version 2.1
PC Color 3270 PC Color
------------ -------------
Cyan Turquoise
Magenta Pink
Brown Yellow
Light Gray White
5
QWIKC Screen Utilities Reference Guide, Version 2.1
2. F U N C T I O N S
In this section, a detailed description is provided for each function.
---------------------------------------------------------------------------
eosc QWIKC
---------------------------------------------------------------------------
Function Returns the absolute column of the EOS marker.
Syntax unsigned char eosc(void);
Remarks Operates on the currently written screen. The upper left
corner of the screen (1,1).
Return value eosc returns the absolute column of the EOS marker.
Screens All video pages and virtual screens.
See also eosr, eostorc, eostorcrel, eostocursor, eosln, gotoeos
---------------------------------------------------------------------------
eosln QWIKC
---------------------------------------------------------------------------
Function Moves the EOS marker to column 1 of the next row.
Syntax void eosln(void);
Remarks Operates on the currently written screen.
Return value None.
Screens All video pages and virtual screens.
EOS Updated.
Restrictions eosln can increment past the last row of a screen, but does
not scroll up the screen.
See also eosr, eosc, eostorc, eostorcrel, eostocursor, gotoeos,
qeosln
---------------------------------------------------------------------------
eosr QWIKC
---------------------------------------------------------------------------
Function Returns the absolute row of the EOS marker.
Syntax unsigned char eosr(void);
Remarks Operates on the currently written screen.
Return value eosr returns the absolute row of the EOS marker.
Screens All video pages and virtual screens.
See also eosc, eostorc, eostorcrel, eostocursor, eosln, gotoeos
---------------------------------------------------------------------------
eostocursor QWIKC
---------------------------------------------------------------------------
Function Positions the EOS marker to where the cursor is.
Syntax void eostocursor(void);
Remarks The EOS marker is simply moved to match the position of the
cursor of the currently written video page.
Return value None.
Screens All video pages only.
EOS Updated.
See also eosr, eosc, eostorc, eostorcrel, eosln, gotoeos
6
QWIKC Screen Utilities Reference Guide, Version 2.1
---------------------------------------------------------------------------
eostorc QWIKC
---------------------------------------------------------------------------
Function Positions the EOS marker.
Syntax void eostorc( unsigned char row, unsigned char col );
Remarks Use this procedure to manually locate the EOS marker. The
q*eos functions will write where this marker is located on
the currently written screen.
Return value None.
Screens All video pages and virtual screens.
EOS Updated.
Restrictions Stay within the screen limits.
See also eosr, eosc, eostorcrel, eostocursor, eosln, gotoeos
---------------------------------------------------------------------------
eostorcrel QWIKC
---------------------------------------------------------------------------
Function Positions the EOS marker relative to its current position.
Syntax void eostorcrel( unsigned char row, unsigned char col );
Remarks The relative values can be positive or negative. The q*eos
functions will write where the EOS marker is located on the
currently written screen.
Return value None.
Screens All video pages and virtual screens.
EOS Updated.
Restrictions Stay within the screen limits.
See also eosr, eosc, eostorc, eostocursor, eosln, gotoeos
---------------------------------------------------------------------------
getcursor QWIKC
---------------------------------------------------------------------------
Function Returns the cursor mode for the CRT.
Syntax int getcursor(void);
Remarks There is only one cursor mode variable that applies to what
is currently viewed on the CRT and it is retrieved from low
memory at 0040h:0060h.
Return value getcursor returns the cursor mode for the CRT.
Screens All video pages only.
See also setcursor, modcursor
---------------------------------------------------------------------------
get_submodel_id QWIKC
---------------------------------------------------------------------------
Function Gets the submodel_id on IBM computers.
Syntax void get_submodel_id(void);
Remarks The system_id and submodel_id variables are updated if a
submodel ID exists. It will only execute on recent models
of XT, AT, and PS/2 models which have this ID. Otherwise
the variables will remain unaltered as set by qinit().
Return value None. The result of the submodel ID check is stored in
submodel_id.
Restrictions PC or XT clones must recognize IBM's system ID.
See also QWIKC21.DOC
7
QWIKC Screen Utilities Reference Guide, Version 2.1
---------------------------------------------------------------------------
gotoeos QWIKC
---------------------------------------------------------------------------
Function Positions the cursor where the EOS marker is.
Syntax void gotoeos(void);
Remarks The cursor is simply moved to match the position of the EOS
marker of the currently written video page.
Return value None.
Screens All video pages only.
EOS Unaltered.
See also eosr, eosc, eostorc, eostorcrel, eostocursor, eosln, gotorc
Example Center a string on the screen and place the cursor at the
end of the string:
qwritec( 1, 1, crt_cols, SAMEATTR, "My message " );
gotoeos();
---------------------------------------------------------------------------
gotorc QWIKC
---------------------------------------------------------------------------
Function Positions the cursor.
Syntax void gotorc( unsigned char row, unsigned char col );
Remarks The cursor is moved to the position absolute to the
currently written video page.
Return value None.
Screens All video pages only.
EOS Unaltered.
Restrictions Stay within the screen limits.
See also gotoeos, wherer, wherec
---------------------------------------------------------------------------
modcursor QWIKC
---------------------------------------------------------------------------
Function Modifies the current cursor mode to turn on, off, or blink
erratically.
Syntax void modcursor( int bits13and14 );
Remarks Using the modification macros cursor_on, cursor_off, or
cursor_blink for bits13and14, the currently viewed cursor
mode on the CRT will be modified accordingly. The function
only looks at bits 13 and 14 of bits13and14 for the
modification. The scan lines remain unaltered.
Return value None.
Screens Any video page as viewed.
See also getcursor, setcursor
Example To turn the current cursor mode off:
modcursor( cursor_off );
8
QWIKC Screen Utilities Reference Guide, Version 2.1
---------------------------------------------------------------------------
qattr QWIKC
---------------------------------------------------------------------------
Function Changes just the attribute in a rows-by-columns block on the
screen.
Syntax void qattr( unsigned char row, unsigned char col,
unsigned char rows, unsigned char cols,
int attr );
Remarks The upper left corner of the block starts at (row,col) and
the block size is rows by cols. Note that you can even
change 1 row and/or 1 column. If SAMEATTR is used for attr
or if rows or cols is zero, then nothing is written.
Return value None.
Screens All video pages and virtual screens.
EOS Updated.
Restrictions Stay within the screen limits.
See also qattrc, qattreos
Example To create inverse video on any screen:
qattr( 1, 1, crt_rows, crt_cols, BLACK+LIGHTGRAY_BG );
---------------------------------------------------------------------------
qattrc QWIKC
---------------------------------------------------------------------------
Function Changes just the attribute in a rows-by-columns block on the
screen and centers it between two columns.
Syntax void qattrc( unsigned char row, unsigned char coll,
unsigned char colr, unsigned char rows,
unsigned char cols, int attr );
Remarks The upper left corner of the block starts at
(row,(coll+colr-cols+1) >> 1) with a block size of rows by
cols and centering it between the two columns coll and colr.
Odd counts are shifted left. If SAMEATTR is used for attr
or if rows or cols is zero, then nothing is written.
Return value None.
Screens All video pages and virtual screens.
EOS Updated.
Restrictions Stay within the screen limits.
See also qattr, qattreos
Example A 30 character message centered on the screen in row 15,
needs to be white on green:
qattrc( 15, 1, crt_cols, 1, 30, WHITE+GREEN_BG );
The attribute will start to be changed in column 26 on an 80
column screen.
---------------------------------------------------------------------------
qattreos QWIKC
---------------------------------------------------------------------------
Function Changes just the attribute in a rows-by-columns block on the
current screen starting at the EOS marker.
Syntax void qattreos( unsigned char rows, unsigned char cols,
int attr );
Remarks The upper left corner of the block starts at the previously
9
QWIKC Screen Utilities Reference Guide, Version 2.1
set EOS marker and the block size is rows by cols. If
SAMEATTR is used for attr or if rows or cols is zero, then
nothing is written.
Return value None.
Screens All video pages and virtual screens.
EOS Updated.
Restrictions Stay within the screen limits.
See also qattr, qattrc
Example To highlight a 20 column data entry field at the EOS marker
with yellow on magenta:
qattreos( 1, 20, YELLOW+MAGENTA_BG );
---------------------------------------------------------------------------
qeosln QWIKC
---------------------------------------------------------------------------
Function Moves the EOS marker to column 1 of the next row with a
possible scroll up.
Syntax void qeosln(void);
Remarks Operates on the currently written screen. If eosr becomes
greater than crt_rows, then the screen will scroll up. The
new blank row will have the attribute set by scroll_attr
which must be manually set before hand. scroll_attr is
defined in QWIKC21.H.
Return value None.
Screens All video pages and virtual screens.
EOS Updated to first cleared column of the cleared row.
See also eosr, eosc, eostorc, eostorcrel, eostocursor, gotoeos, eosln
---------------------------------------------------------------------------
qfill QWIKC
---------------------------------------------------------------------------
Function Fills the screen with a character with an optional attribute
change in a rows-by-columns block on the current screen.
Syntax void qfill( unsigned char row, unsigned char col,
unsigned char rows, unsigned char cols,
int attr, unsigned char ch );
Remarks The upper left corner of the block starts at (row,col) and
the block size is rows by cols. If SAMEATTR is used for
attr, then the attribute will remain the same on the screen.
If rows or cols is zero, then nothing is written.
Return value None.
Screens All video pages and virtual screens.
EOS Updated.
Restrictions Stay within the screen limits.
See also qfillc, qfilleos
Example To clear the screen with black on brown attribute:
qfill( 1, 1, crt_rows, crt_cols, BLACK+BROWN_BG, ' ' );
---------------------------------------------------------------------------
qfillc QWIKC
---------------------------------------------------------------------------
Function Fills the screen with a character and an optional attribute
change in a rows-by-columns block on the current screen and
10
QWIKC Screen Utilities Reference Guide, Version 2.1
centers it between two columns.
Syntax void qfillc( unsigned char row, unsigned char coll,
unsigned char colr, unsigned char rows,
unsigned char cols, int attr,
unsigned char ch );
Remarks The upper left corner of the block starts at
(row,(coll+colr-cols+1) >> 1) with a block size of rows by
cols and centered between the two columns coll and colr.
Odd counts are shifted left. If SAMEATTR is used for attr,
then the attribute will remain the same on the screen. If
rows or cols is zero, then nothing is written.
Return value None.
Screens All video pages and virtual screens.
EOS Updated.
Restrictions Stay within the screen limits.
See also qfill, qfilleos
Example Center 20 dashes on the screen in rows 1 to 5 with black on
brown attributes:
qfillc( 1, 1, crt_cols, 5, 20, BLACK+BROWN_BG, '-' );
---------------------------------------------------------------------------
qfilleos QWIKC
---------------------------------------------------------------------------
Function Fills the screen with a character with an optional attribute
change in a rows-by-columns block on the current screen
starting at the EOS marker.
Syntax void qfilleos( unsigned char rows, unsigned char cols,
int attr, unsigned char ch );
Remarks The upper left corner of the block starts at the previously
set EOS marker and the block size is rows by cols. If
SAMEATTR is used for attr, then the attribute will remain
the same on the screen. If rows or cols is zero, then
nothing is written.
Return value None.
Screens All video pages and virtual screens.
EOS Updated.
Restrictions Stay within the screen limits.
See also qfill, qfillc
Example To clear a 20 column data entry field at the EOS marker with
yellow on magenta:
qfilleos( 1, 20, YELLOW+MAGENTA_BG, ' ' );
---------------------------------------------------------------------------
qinit QWIKC
---------------------------------------------------------------------------
Function Detects system, display, and video card(s). Initializes
global data for QWIKC routines.
Syntax void qinit(void);
Remarks qinit() must be called at the start of your program to
initialize QWIKC. qreinit() should be called if there is a
text mode change.
Return value None. QWIKC's global variables are set to match the video
configuration of your system.
11
QWIKC Screen Utilities Reference Guide, Version 2.1
EOS Set to (1,1).
See also qreinit(), QWIKC21.DOC, QINITEST.C, VARIABLES section below.
---------------------------------------------------------------------------
qreadattr QWIKC
---------------------------------------------------------------------------
Function Reads an attribute from the current screen.
Syntax unsigned char qreadattr( unsigned char row,
unsigned char col );
Remarks Reads an attribute from the screen at just one location.
Return value qreadattr returns the attribute read from the screen.
Screens All video pages and virtual screens.
EOS Unaltered.
See also qreadchar, qreadstr
---------------------------------------------------------------------------
qreadchar QWIKC
---------------------------------------------------------------------------
Function Reads a character from the current screen.
Syntax unsigned char qreadchar( unsigned char row,
unsigned char col );
Remarks Reads a character from the screen at just one location.
Return value qreadchar returns the character read from the screen.
Screens All video pages and virtual screens.
EOS Unaltered.
See also qreadattr, qreadstr
---------------------------------------------------------------------------
qreadstr QWIKC
---------------------------------------------------------------------------
Function Reads a text string from the current screen.
Syntax void qreadstr( char far *astr, unsigned char row,
unsigned char col, unsigned char cols );
Remarks Reads a string of characters from the screen, storing it in
the location pointed to by astr.
Return value None.
Screens All video pages and virtual screens.
EOS Unaltered.
See also qreadattr, qreadchar
---------------------------------------------------------------------------
qreinit QWIKC
---------------------------------------------------------------------------
Function Detects system, display, and video card(s). Reinitializes
global data for QWIKC routines.
Syntax void qreinit(void);
Remarks qreinit() must be called after changing text modes to re-
initialize QWIKC. qinit() must be called at the start of
your program.
Return value None. QWIKC's global variables are reset to match the new
text mode and video configuration of your system.
EOS Set to (1,1).
See also qinit(), QWIKC21.DOC, QINITEST.C, VARIABLES section below.
12
QWIKC Screen Utilities Reference Guide, Version 2.1
---------------------------------------------------------------------------
qscrolldown QWIKC
---------------------------------------------------------------------------
Function Scrolls a rows-by-columns block down on the current screen
and clears the top row of the block.
Syntax void qscrolldown( unsigned char row, unsigned char col,
unsigned char rows, unsigned char cols,
int blankattr );
Remarks To keep it simple, the block encompasses all affected rows
including the row to be cleared. The upper left corner of
the block starts at (row,col) and the block size is rows by
cols. The bottom row will be scrolled out and lost while
the top row will be cleared with the attribute of blankattr
(SAMEATTR is permitted). Note that you can even change 1
row and/or 1 column. The cursor is not moved, but is ready
to be moved with gotoeos. The cpuid lets the routine choose
the best speed.
Return value None.
Screens All video pages and virtual screens.
EOS Updated to first cleared column of the cleared row.
Restrictions Stay within the screen limits.
See also qscrollup, gotoeos
Example To scroll down the entire screen and clear the top row with
light cyan on blue:
qscrolldown( 1,1, crt_rows, crt_cols, LIGHTCYAN+BLUE_BG );
---------------------------------------------------------------------------
qscrollup QWIKC
---------------------------------------------------------------------------
Function Scrolls a rows-by-columns block up on the current screen and
clears the bottom row of the block.
Syntax void qscrollup( unsigned char row, unsigned char col,
unsigned char rows, unsigned char cols,
int blankattr );
Remarks To keep it simple, the block encompasses all affected rows
including the row to be cleared. The upper left corner of
the block starts at (row,col) and the block size is rows by
cols. The first row will be scrolled out and lost while the
last row will be cleared with the attribute of blankattr
(SAMEATTR is permitted). Note that you can even change 1
row and/or 1 column. The cursor is not moved, but is ready
to be moved with gotoeos. The cpuid lets the routine choose
the best speed.
Return value None.
Screens All video pages and virtual screens.
EOS Updated to first cleared column of the cleared row.
Restrictions Stay within the screen limits.
See also qscrolldown, gotoeos
Example To scroll up the entire screen and clear the last row with
light cyan on blue:
qscrollup( 1, 1, crt_rows, crt_cols, LIGHTCYAN+BLUE_BG );
13
QWIKC Screen Utilities Reference Guide, Version 2.1
---------------------------------------------------------------------------
qscrtovscr QWIKC
---------------------------------------------------------------------------
Function Copies a rows-by-columns block on the current screen to
another location on a virtual screen.
Syntax void qscrtovscr( unsigned char row, unsigned char col,
unsigned char rows, unsigned char cols,
unsigned char vrow, unsigned char vcol,
unsigned char vwidth, void far *vscrptr );
Remarks row, col, rows, and cols locates the block on the current
screen (scr) as specified by qscr. This block will be
copied to the virtual screen (vscr) at the location of vrow
and vcol. But since vscr may have a different column width
than scr, vwidth sets the width. vscrptr is the base ad-
dress of the virtual screen. By changing qscr, you can even
copy blocks from one virtual screen to another! Only the
scr side checks for possible snow.
Return value None.
Screens All video pages and virtual screens.
EOS Unaltered.
Restrictions Stay within the screen limits. Not intended for copying
between video pages (esp. CGA).
See also qvscrtoscr
Example Copy a 12x40 block from the CRT screen at (5,10) to a
virtual screen at (3,2) and look at the result on the CRT:
#include <stdio.h>
#include <conio.h>
#include "qwikc21.h"
#define vscrrows 20
#define vscrcols 60
/* Storage size in bytes required is: rows * cols << 1 */
int vscr[vscrrows][vscrcols]; /* 20 x 60 virtual screen */
vscr_t crt,myvscr;
main() {
qinit();
/* create specs for virtual screen */
myvscr.vrows=vscrrows;
myvscr.vcols=vscrcols;
myvscr.vsize=sizeof(vscr);
myvscr.vsnow=0; /* qwikest when 0 */
myvscr.veosofs=0;
myvscr.vscrptr=𝓋
qfill( 1, 1, crt_rows, crt_cols, WHITE+BLUE_BG, '*' ); /* Fill CRT */
crt=qscr; /* Save CRT specs */
qscr=myvscr; /* Set virtual specs */
qfill(1, 1, vscrrows, vscrcols, BLACK+BROWN_BG, '?'); /* Fill vscr */
qscr=crt; /* Restore CRT specs */
qscrtovscr( 5, 10, 12, 40, 3, 2, vscrcols, vscr ); /* Copy block */
qstoretoscr( 1, 1, vscrrows, vscrcols, vscr ); /* Take a look */
14
QWIKC Screen Utilities Reference Guide, Version 2.1
getch();
return;
}
---------------------------------------------------------------------------
qstoretomem QWIKC
---------------------------------------------------------------------------
Function Saves a rows-by-columns block from the current screen to
memory.
Syntax void qstoretomem( unsigned char row, unsigned char col,
unsigned char rows, unsigned char cols,
void far *dest );
Remarks row, col, rows, and cols locates the block on the current
screen as specified by qscr. This block will be copied to
dest, the destination, as one contiguous array. By changing
qscr, you can even save blocks from virtual screens! Be
sure to set qsnow to false for the fastest speed on virtual
screens.
Return value None.
Screens All video pages and virtual screens.
EOS Unaltered.
Restrictions Stay within the screen limits. Not intended for copying
between video pages (esp. CGA).
See also qstoretoscr
Example Save a 12x40 block from the CRT screen at (5,10), clear the
screen, and restore the block:
#include <stdio.h>
#include <conio.h>
#include "qwikc21.h"
#define memrows 12
#define memcols 40
/* Storage size in bytes required is: rows * cols >> 1 */
int block[memrows][memcols]; /* 12 x 40 block */
main() {
qinit();
qfill( 1, 1, crt_rows, crt_cols, WHITE+BLUE_BG, '*'); /* Fill CRT */
qstoretomem( 5, 10, memrows, memcols, block ); /* Save block */
qfill(1,1, crt_rows, crt_cols, YELLOW+BLACK_BG,' '); /* Clear CRT */
qstoretoscr( 5, 10, memrows, memcols, block ); /* Take a look */
getch();
return;
}
---------------------------------------------------------------------------
qstoretoscr QWIKC
---------------------------------------------------------------------------
Function Writes a rows-by-columns block to the current screen from
memory.
Syntax void qstoretoscr( unsigned char row, unsigned char col,
15
QWIKC Screen Utilities Reference Guide, Version 2.1
unsigned char rows, unsigned char cols,
void far *source );
Remarks row and col locates the upper left corner of the block on
the current screen as specified by qscr. A block will be
written from source, which is one contiguous array, and
placed on the screen as a rows-by-cols block. By changing
qscr, you can even place blocks to virtual screens! Be sure
to set qsnow to 0 for the fastest speed on virtual screens.
Return value None.
Screens All video pages and virtual screens.
EOS Unaltered.
Restrictions Stay within the screen limits. Not intended for copying
between video pages (esp. CGA).
See also qstoretomem
Example Save a 12x40 block from the CRT screen at (5,10) in the
heap, clear the screen, and restore the block:
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include "qwikc21.h"
#define memrows 12
#define memcols 40
/* Storage size in bytes required is: rows * cols << 1 */
int *block;
main() {
qinit();
qfill( 1, 1, crt_rows, crt_cols, WHITE+BLUE_BG, '*' ); /* Fill CRT */
block=malloc(memrows * memcols << 1); /* Reserve heap */
qstoretomem( 5, 10, memrows, memcols, block ); /* Save Block */
qfill(1,1, crt_rows, crt_cols, YELLOW+BLACK_BG, ' '); /* Clear CRT */
qstoretoscr( 5, 10, memrows, memcols, block ); /* Take a look */
free(block); /* Free heap */
getch();
return;
}
---------------------------------------------------------------------------
qviewpage QWIKC
---------------------------------------------------------------------------
Function Changes the video page to be viewed on the CRT.
Syntax void qviewpage( char pagenum );
Remarks Standard C routines are dedicated only to video page 0.
However, most video cards, except MDA and some 3270 PC, have
more than one video page. This procedure enables you to
view those pages. The number of video pages available is
detected by qinit and saved in maxpage. pagenum is 0-based
and the routine will only view other pages when pagenum <=
maxpage. The macro videopage is used to get/set the
currently viewed page.
Return value None.
Screens All video pages.
16
QWIKC Screen Utilities Reference Guide, Version 2.1
EOS Unaltered.
See also qwritepage, QWIKC21D.DOC, QINITEST.C
---------------------------------------------------------------------------
qvscrtoscr QWIKC
---------------------------------------------------------------------------
Function Copies a rows-by-columns block from a virtual screen to
another location on the current screen.
Syntax void qvscrtoscr( unsigned char row, unsigned char col,
unsigned char rows, unsigned char cols,
unsigned char vrow, unsigned char vcol,
unsigned char vwidth, void far *vscrptr );
Remarks row, col, rows, and cols locates the destination on the
current screen (scr) as specified by qscr. A block will be
copied from the virtual screen (vscr) at the location of
vrow and vcol. But since vscr may have a different column
width than scr, vwidth sets the width. vscrptr is the base
address of the virtual screen. By changing qscr, you can
even copy blocks from one virtual screen to another! Only
the scr side checks for possible snow.
Return value None.
Screens All video pages and virtual screens.
EOS Unaltered.
Restrictions Stay within the screen limits. Not intended for copying
between video pages (esp. CGA).
See also qscrtovscr
Example Copy a 12x40 block from the CRT screen at (5,10) to a
virtual screen at (3,2) and look at the result on the CRT:
#include <stdio.h>
#include <conio.h>
#include "qwikc21.h"
#define vscrrows 20
#define vscrcols 60
/* Storage size in bytes required is: rows * cols << 1 */
int vscr[vscrrows][vscrcols]; /* 20 x 60 virtual screen */
vscr_t crt,myvscr;
main() {
qinit();
/* create specs for virtual screen */
myvscr.vrows=vscrrows;
myvscr.vcols=vscrcols;
myvscr.vsize=sizeof(vscr);
myvscr.vsnow=0; /* qwikest when 0 */
myvscr.veosofs=0;
myvscr.vscrptr=𝓋
qfill( 1, 1, crt_rows, crt_cols, WHITE+BLUE_BG, '*' ); /* Fill CRT */
crt=qscr; /* Save CRT specs */
qscr=myvscr; /* Set virtual specs */
qfill(1, 1, vscrrows, vscrcols, BLACK+BROWN_BG, '?'); /* Fill vscr */
17
QWIKC Screen Utilities Reference Guide, Version 2.1
qscr=crt; /* Restore CRT specs */
qscrtovscr( 5, 10, 12, 40, 3, 2, vscrcols, vscr ); /* Copy Block */
qstoretoscr( 1, 1, vscrrows, vscrcols, vscr ); /* Take a look */
getch();
return;
}
---------------------------------------------------------------------------
qwrite QWIKC
---------------------------------------------------------------------------
Function Writes a string to the current screen with an optional
attribute change.
Syntax void qwrite( unsigned char row, unsigned char col,
int attr, char far *astr );
Remarks This routine writes the string astr at (row,col) with the
attribute attr. If SAMEATTR is used for attr, then the
attribute will remain the same on the screen.
Return value None.
Screens All video pages and virtual screens.
EOS Updated.
Restrictions Stay within the screen limits.
See also qwritec, qwrite_sub, qwriteeos, qwriteeos_sub
Example Write the string "Important" at (2,1) with the attribute of
flashing white on red:
qwrite( 2, 1, BLINK+WHITE+RED_BG, "Important" );
---------------------------------------------------------------------------
qwritec QWIKC
---------------------------------------------------------------------------
Function Writes a string to the current screen with an optional
attribute change and centered between two columns.
Syntax void qwritec( unsigned char row, unsigned char coll,
unsigned char colr, int attr,
char far *astr );
Remarks This routine writes the string astr at (row,(coll+colr-
strlen(astr)+1) >> 1) which centers it between the two
columns coll and colr and has the attribute attr. If
SAMEATTR is used for attr, then the attribute will remain
the same on the screen.
Return value None.
Screens All video pages and virtual screens.
EOS Updated.
Restrictions Stay within the screen limits.
See also qwrite, qwrite_sub, qwriteeos, qwriteeos_sub
Example Write a message centered on the screen in row 15 with black
on green attributes:
qwritec( 15, 1, crt_cols, WHITE+GREENBG, "My message" );
The message will be written in column 36 on an 80 column
screen.
18
QWIKC Screen Utilities Reference Guide, Version 2.1
---------------------------------------------------------------------------
qwriteeos QWIKC
---------------------------------------------------------------------------
Function Writes a string to the current screen with an optional
attribute change starting at the EOS marker.
Syntax void qwriteeos( int attr, char far *astr );
Remarks This routine writes the string astr at the EOS marker with
the attribute attr. If SAMEATTR is used for attr, then the
attribute will remain the same on the screen.
Return value None.
Screens All video pages and virtual screens.
EOS Updated.
Restrictions Stay within the screen limits.
See also qwrite, qwrite_sub, qwritec, qwriteeos_sub
Example Highlight the number in the following message:
qwrite( 1, 1, WHITE+BLUE_BG, "There are" );
qwriteeos( YELLOW+BLUE_BG, " 5 " );
qwriteeos( WHITE+BLUE_BG, "minutes left." );
which will write "There are 5 minutes left." as white on
blue except "5" will be yellow on blue.
---------------------------------------------------------------------------
qwriteeos_sub QWIKC
---------------------------------------------------------------------------
Function Writes an array (or string) with a specified length to the
current screen with an optional attribute change starting at
the EOS marker.
Syntax void qwriteeos_sub( int attr, int length, char far *astr );
Remarks This routine writes length characters of the string pointed
to by astr at the previously set EOS marker with the
attribute attr. This enables you to write substrings when
specifying a starting index (astr[i]). (Other routines like
qwriteeos stop at the null-terminating character.) Of
course, astr can be any char array or char pointer. If
SAMEATTR is used for attr, then the attribute will remain
the same on the screen.
Return value None.
Screens All video pages and virtual screens.
EOS Updated.
Restrictions Stay within the screen limits.
See also qwrite_sub, qwritec, qwriteeos,
Example The following code will write "Testing step B" with the
existing screen attributes:
strcpy( mystr, "Now for step B: Testing out this line." );
qwrite_sub( 1, 5, SAMEATTR, 8, &mystr[16] );
qwriteeos_sub( SAMEATTR, 6, &mystr[8]);
---------------------------------------------------------------------------
qwritepage QWIKC
---------------------------------------------------------------------------
Function Changes the video page on which the QWIKC routines write.
Syntax void qwritepage( char pagenum );
19
QWIKC Screen Utilities Reference Guide, Version 2.1
Remarks Standard C routines are dedicated to only video page 0.
However, most video cards, except MDA and some 3270 PC, have
more than one video page. This function enables QWIKC
routines to write to those pages by altering qscrofs and
qvideo_page which is the current page on which QWIKC is
writing. The number of video pages available is detected by
qinit() and saved in maxpage. The routine will only change
pages when pagenum <= maxpage.
Return value None.
Screens All video pages.
EOS Unaltered.
See also qviewpage, QWIKC21.DOC, QINITEST.C
---------------------------------------------------------------------------
qwrite_sub QWIKC
---------------------------------------------------------------------------
Function Writes an array (or string) with a specified length to the
current screen with an optional attribute change.
Syntax void qwrite_sub( unsigned char row, unsigned char col,
int attr, int length, char far *astr );
Remarks This routine writes length characters of the string astr at
(row,col) with the attribute attr. This enables you to
write substrings when specifying a starting index (astr[i]).
(Other routines like qwrite stop at the null-terminating
character.) Of course, astr can be any char array or char
pointer. If SAMEATTR is used for attr, then the attribute
will remain the same on the screen.
Return value None.
Screens All video pages and virtual screens.
EOS Updated.
Restrictions Stay within the screen limits.
See also qwrite, qwritec, qwriteeos, qwriteeos_sub
Example The following code will write "Testing out this line." with
the existing screen attributes:
strcpy( mystr, "Step B: Testing out this line." );
qwrite_sub( 1, 1, SAMEATTR, 22, &mystr[9] );
---------------------------------------------------------------------------
setcursor QWIKC
---------------------------------------------------------------------------
Function Sets a new cursor mode for the CRT.
Syntax void setcursor( int cursor );
Remarks Using the default cursor variables set by qinit and/or the
cursor macros, a new cursor mode can be set by with any
combination of:
cursor_initial - detected by qinit at startup
cursor_underline - set by qinit
cursor_halfblock - set by qinit
cursor_block - set by qinit
cursor_off ($2000) - turns cursor off
cursor_blink ($6000) - erratic blinking (MDA/CGA)
You can simply add them together (logically ORing is best to
20
QWIKC Screen Utilities Reference Guide, Version 2.1
prevent carry errors, but arithmetic addition is fine).
Although a separate cursor location is kept for each video
page, there is only one cursor mode for the CRT screen.
Screens Any video page as viewed.
See also getcursor, modcursor
Example 1 Set a half-block cursor with erratic blink:
setcursor( cursor_halfblock+cursor_blink );
Example 2 Set the scan lines for a block cursor, but leave it turned
off:
setcursor( cursor_block+cursor_off );
Example 3 Restore the cursor mode at start up and be sure it's turned
on:
setcursor( cursor_initial );
modcursor( cursor_on );
or, for those comfortable with bit operations:
setcursor( cursor_initial & !cursor_blink );
---------------------------------------------------------------------------
setmultitask QWIKC
---------------------------------------------------------------------------
Function Set QWIKC variables to write direct to multi-tasking video
buffers (MTVB).
Syntax void setmultitask(void);
Remarks This function alters the following variables if the program
is running under a multi-tasking environment and the user
has chosen to use the faster MTVB. If there is no multi-
tasking environment or the MTVB is not used (normal direct
screen video), then these variables are unaltered. If you
use Turbo C's conio routines, be sure to set directvideo to
0 when using the MTVB.
qscrptr - the segment is altered, but the offset is
usually 0.
page0seg - set to match qscrseg to indicate page 0.
qsnow - set to 0.
inmultask - 1 if using MTVB, otherwise set to 0.
See also inmultask in VARIABLES section below.
---------------------------------------------------------------------------
wherec QWIKC
---------------------------------------------------------------------------
Function Returns the absolute column of the cursor on the currently
written video page.
Syntax unsigned char wherec(void);
Remarks Operates on the currently written video page. The upper
left corner of the screen (1,1).
Return value None.
21
QWIKC Screen Utilities Reference Guide, Version 2.1
Screens All video pages only.
See also gotorc, wherer
---------------------------------------------------------------------------
wherer QWIKC
---------------------------------------------------------------------------
Function Returns the absolute row of the cursor on the currently
written video page.
Syntax unsigned char wherer(void);
Remarks Operates on the currently written video page. The upper
left corner of the screen (1,1).
Return value None.
Screens All video pages only.
See also gotorc, wherec
---------------------------------------------------------------------------
22
QWIKC Screen Utilities Reference Guide, Version 2.1
3. V A R I A B L E S
The variables in QWIKC are initialized according to the the kind of system,
display(s), and video adapter(s) that qinit detects. QWIKC uses them for
reference and they may also be used in your own programming to help make
decisions.
SYSTEM HARDWARE
System Hardware Variables - These variables indicate the kind of computer
that qinit detected:
Variable Description
------------ -----------------------------------------------------------
cpuid (Type: char) Intel CPU identification code. cpuid can be
equal to any one of the following four marcos:
cpu8086 - Intel 8086/8088
cpu80186 - Intel 80186/80188
cpu80286 - Intel 80286
cpu80386 - Intel 80386
system_id (Type: char) Code for the IBM computer in use, set by
qinit. See submodel_id for values.
submodel_id (Type: char) Code for the sub-model of the IBM computer in
use. This value defaults to 0 the first time qinit is run.
To get a value, execute get_submodel_id.
SysID Submodel SYSTEM
----- -------- ------------------------------
0xFF n/a IBM PC
0xFE n/a IBM PC XT
0xFD n/a IBM PCjr
0xFC n/a IBM PC AT (6 MHz, 01/10/84)
0x00 IBM PC AT (6 MHz, 06/10/85)
0x01 IBM PC AT (8 MHz, 11/15/85)
0x02 IBM PC XT (286)
0x04 IBM PS/2 model 50
0x05 IBM PS/2 model 60
0xFB 0x00 IBM PC XT (256/640)
0xFA 0x00 IBM PS/2 model 30
0x01 IBM PS/2 model 25
0xF9 0x00 IBM PC Convertible
0xF8 0x00 IBM PS/2 model 80 (16 MHz)
0x04 IBM PS/2 model 80 (20 MHz)
0x09 IBM PS/2 model 70 (16 MHz)
23
QWIKC Screen Utilities Reference Guide, Version 2.1
VIDEO HARDWARE
Video Hardware Variables - These variables indicate the kind of video
card(s) and display(s) that qinit detected:
Variable Description
------------- ---------------------------------------------------
active_disp_dev (Type: char) Code for the Active Display Device.
Using IBM's Display Combination Code (DCC), qinit
detects the video adapter combined with the video
display. The codes have been set to the following
macros. Note that monochrome is odd and color is
even:
Macro Code Description
---------- ----- --------------------------------
no_display 0x00 No display
mda_mono 0x01 MDA with 5151 monochrome display
cga_color 0x02 CGA with 5153/4 color display
dcc3 0x03 reserved
ega_color 0x04 EGA with 5153/4 color
ega_mono 0x05 EGA with 5151 monochrome
pgc_color 0x06 PGC with 5175 color
vga_mono 0x07 VGA with analog monochrome
vga_color 0x08 VGA with analog color
dcc9 0x09 reserved
dcc10 0x0A reserved
mcga_mono 0x0B MCGA with analog monochrome
mcga_color 0x0C MCGA with analog color
n/a 0x0D to 0xFE - reserved
unknown 0xFF unknown device
active_disp_dev_3270 (Type: char) Code for the Active Display Device on
the 3270 PC. Only the 0xFF code corresponds to the
macro "unknown".
Code Monitor Adapter
---- ------------ ---------------------
0x00 5151 or 5272 for 5151 or 5272
0x01 3295 for 3295
0x02 5151 or 5272 for 5151 or 5272 plus
XGA graphics
0x03 5279 3270 PC G
0x04 5379 C01 3270 PC GX
0x05 5379 M01 3270 PC GX
0x06 reserved
0x07 reserved
0xFF Unknown, not a 3270 PC
alt_disp_dev (Type: char) Code for the Alternate Display Device.
This code is detected by qinit for a second (but
inactive) adapter and display, just in case there
are dual monitors. It uses the same macros as
active_disp_dev listed above.
24
QWIKC Screen Utilities Reference Guide, Version 2.1
alt_disp_dev_pcc (Type: int) Code for the Alternate Display adapter
on the PC Convertible. In hex, it corresponds to
the model number of the attached device:
Model Description
------ --------------------
0x 0 No alternate adapter
0x5140 LCD
0x5153 CGA type
0x5151 Monochrome type
cardseg (Type: int) Video segment address of the video
"card" as detected by qinit.
cardsnow (Type: char) Set to 1 for wait-for-retrace for the
video "card" as detected by qinit.
egainfo (Type: macro) Returns the value at 0x0040:0x0087
which has the following information when the EGA
(or VGA) is present:
Bits Description
---- -------------------------------------------
7 (0) Clear, (1) Keep video data after
video mode set
6,5 (00) 64k, (01), 128k, (10) 192k, (11) 256k,
memory on the card.
4 Reserved
3 (0) EGA active, (1) EGA not active
2 (0) Disable, (1) Enable wait-for-display
1 (0) CD/ECD (1) MD attached
0 (0) Active, (1) Inactive CD emulation
egaswitches (Type: macro) Using the value this macro points to,
you can determine the monitor connected to the EGA,
the alternate video system, and the start up
default. The byte is a copy of how the dip
switches are set on the card where on=0 and off=1.
The primary is the default. When the ECD is set
for 640x200, it is emulating the CD including the
cursor mode. qinit directly tests for the
alternate device rather than assuming it.
Switch Primary Secondary
-------- ------------------- -------------------
0000 = 0 MDA + MD EGA + CD - 40x25
0001 = 1 MDA + MD EGA + CD - 80x25
0010 = 2 MDA + MD EGA + ECD (640x200)
0011 = 3 MDA + MD EGA + ECD (640x350)
0100 = 4 CGA + CD - 40x25 EGA + MD
0101 = 5 CGA + CD - 80x25 EGA + MD
0110 = 6 EGA + CD - 40x25 MDA + MD
0111 = 7 EGA + CD - 80x25 MDA + MD
1000 = 8 EGA + ECD (640x200) MDA + MD
1001 = 9 EGA + ECD (640x350) MDA + MD
25
QWIKC Screen Utilities Reference Guide, Version 2.1
1010 =10 EGA + MD CGA + CD - 40x25
1011 =11 EGA + MD CGA + CD - 80x25
have_3270 (Type: char) If qinit detects 3270 PC equipment or
software, this variable is set to 1. In addition,
the active_disp_dev is either mda_mono or
cga_color. Note that there may or may not be
graphics capability in either case; qinit is not
meant to detect graphics. See active_disp_dev_3270
for codes.
have_ps2 (Type: char) qinit sets have_ps2 to true if the DCC
is supported. This means that the program has
detected a PS/2 video card whether it is integrated
on a model 30, a PS/2 Display Adapter installed on
an IBM XT, or the like. It also means that either
MCGA or VGA is present, but not necessarily active.
To know which, just check the DCC.
herc_model (Type: char) Model of the attached Hercules video
card. If no card is detected, then
herc_model=no_herc.
Macro Code Description
------------ ---- ---------------------
no_herc 0 No Hercules card
hgc_mono 1 HGC
hgc_plus 2 HGC Plus
herc_incolor 3 Hercules InColor Card
maxpage (Type: char) Maximum possible 0-based video page
number. See TABLE 1 in QWIKC21.DOC for ranges.
VIDEO SOFTWARE
Video Software Variables - These variables indicate the current video mode
and screen characteristics to which QWIK is writing and what is being
viewed on the CRT. There are several pointer macros listed that duplicate
some of the global variables, i.e., crtcolumns and crt_cols. It is
preferable to use the global ones, where the pointer macros are only needed
for handling exceptions.
Variable Description
------------ -----------------------------------------------------------
crt_cols (Type: macro) Defined as qscr.vcols (current virtual/actual
screen columns). qscr.vcols is initialized by
qinit/qreinit to the currently viewed number of CRT columns
for any card or video mode.
crtcolumns (Type: macro) Defined to directly access the 1-based
currently viewed number of CRT columns for any card or
video mode. This pseudo-variable may be assigned a value,
as well as evaluated.
26
QWIKC Screen Utilities Reference Guide, Version 2.1
crt_rows (Type: macro) Defined as qscr.vrows (current virtual/actual
screen rows). qscr.vrows is initialized by qinit/qreinit
to the currently viewed number of CRT rows for any card or
video mode.
egafontsize (Type: macro) Defined to directly access the 1-based number
of horizontal scan lines per character for EGA/MCGA/VGA.
This pseudo-variable may be assigned a value, as well as
evaluated.
egarows (Type: macro) Defined to directly access the 0-based number
of rows on the current screen for EGA, MCGA, and VGA. This
number is used to set crt_rows, which is done by qinit.
egarows may be assigned a value as well as evaluated.
inmultitask (Type: char) This flag indicates if MTVB is being used
for the screen in lieu of the normal screen. It defaults
to 0 and is possibly altered with setmultitask if the
multitasking software has be instructed to expect writing
direct to the MTVB (not direct screen).
page0seg (Type: unsigned int) Segment for the base page, page 0. In
multitasking environments, change this value to its video
display buffer. qscrseg and qscrofs should also be set.
qeosofs (Type: macro) Defined as vscr.veosofs, the 0-based offset
where q*eos functions will write.
qscrseg (Type: macro) Acesses the segment of vscr.vscrptr, the
segment for QWIKC writing which is altered when changing
pages. qscrseg=page0seg on page 0.
qscrofs (Type: unsigned int) Offset for QWIKC writing needed for
virtual screens. The usual value is 0 for the video pages.
qscrptr Combines qscrseg and qscrofs
qscr (Type: vscr_t) Structure containing essential variables for
QWIKC screen writing. This structure has several macros
that access its members:
Macro qscr member
-------- -----------
crt_rows vrows
crt_cols vcols
crt_size vsize
qsnow vsnow
qeosofs veosofs
qscrptr vscrptr
These macros are also described in this section. Since
they are part of a structure, qscr's members can be swapped
easily when writing to virtual screens. See the example
under qvscrtoscr.
27
QWIKC Screen Utilities Reference Guide, Version 2.1
qsnow (Type: macro) Set to 1 for wait-for-retrace (snow) while
QWIKC is writing.
qvideo_page (Type: char) Video page to which QWIKC is writing which is
set by qwritepage. It is initially 0.
qvideo_mode (Type: char) Video mode detected by qinit.
scroll_attr (Type: int) The attribute used to clear the blank row when
qeosln is used.
videomode (Type: macro) Defined to directly access the current video
mode in low memory. This pseudo-variable may be assigned
a value, as well as evaluated.
videopage (Type: macro) Defined to directly access the currently
viewed video page in low memory. This pseudo-variable may
be assigned a value, as well as evaluated.
vscr_t The typedef for the structure of essential variables for
QWIKC screen writing to virtual screens. This enables an
easy exchange of data between the CRT and virtual screens.
VIDEO CURSOR
Video Cursor Variables and Macros - These variables and constants give you
easy tools to combine with bit operations to display your choice of cursor
modes. The variables default with the cursor on and no skew which are
detected and set by qinit at startup:
Variable Description
----------------- --------------------------------------------------------
cursor_block (Type: unsigned int) Cursor mode value for the full
cell.
cursor_half_block (Type: unsigned int) Cursor mode value for a half
block usually used for insert editing.
cursor_initial (Type: unsigned int) Cursor mode value detected at
startup.
cursor_underline (Type: unsigned int) Cursor mode value for the normal
underline.
Macro Value Description
------------ ------ ---------------------------------------------------
cursor_blink 0x6000 Used to alter bits 13/14 to create erratic blinking
on MDA/CGA cards. (EGA/VGA cards turn the cursor
off.)
cursor_off 0x2000 Used to alter bits 13/14 or can be used by itself
to turn the cursor off.
28
QWIKC Screen Utilities Reference Guide, Version 2.1
cursor_on 0x0000 Used to alter bits 13/14 in modcursor to turn the
cursor back on.
29